﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;

namespace PlanningGIS.DataConvert.form
{
    public partial class FrmCADOutputSettings : Office2007Form
    {
        private string m_DataType = "cad";
        public FrmCADOutputSettings(string vType)
        {
            InitializeComponent();
            m_DataType = vType;
        }

        private void btn_Sel_Click(object sender, EventArgs e)
        {
            OpenFileDialog cadfiledlg = new OpenFileDialog();
            if (m_DataType == "cad")
            {
                cadfiledlg.Title = "选择CAD模板文件";
                cadfiledlg.Filter = "AutoCAD DWG文件(*.dwg)|*.dwg|AutoCAD DXF文件(*.dxf)|*.dxf|AutoCAD 模板(*.dwt)|*.dwt";
            }
            else if (m_DataType == "dgn")
            {
                cadfiledlg.Title = "选择DGN模板文件（支持V7或者更早的版本）";
                cadfiledlg.Filter = "Microstation DGN文件(*.dgn)|*.dgn";
            }

            if (cadfiledlg.ShowDialog() == DialogResult.OK)
            {
                this.txt_TemplateFile.Text = cadfiledlg.FileName;
            }
        }

        private void FrmCADOutputSettings_Load(object sender, EventArgs e)
        {
            if (m_DataType == "cad")
            {
                combo_Versions.SelectedIndex = combo_Versions.Items.Count - 1;
            }
            else if (m_DataType == "dgn")
            {
                groupPanel1.Enabled = false;
                this.Text = "选择DGN模板文件";
            }
        }
    }
}
